package com.xbzl.cly_demo.vo;

import java.io.Serializable;

public class UsersLoginVO implements Serializable {
    private Long userid;
    private String username;
    private String email;
    private String token;

    // 无参构造器
    public UsersLoginVO() {
    }

    // 全参构造器
    public UsersLoginVO(Long userid, String username, String email, String token) {
        this.userid = userid;
        this.username = username;
        this.email = email;
        this.token = token;
    }

    // Getter 和 Setter
    public Long getUserid() {
        return userid;
    }

    public void setUserid(Long userid) {
        this.userid = userid;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    // toString 方法
    @Override
    public String toString() {
        return "UsersLoginVO{" +
                "userid=" + userid +
                ", username='" + username + '\'' +
                ", email='" + email + '\'' +
                ", token='" + token + '\'' +
                '}';
    }

    // equals 方法
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof UsersLoginVO)) return false;

        UsersLoginVO that = (UsersLoginVO) o;

        if (userid != null ? !userid.equals(that.userid) : that.userid != null) return false;
        if (username != null ? !username.equals(that.username) : that.username != null) return false;
        if (email != null ? !email.equals(that.email) : that.email != null) return false;
        return token != null ? token.equals(that.token) : that.token == null;
    }

    // hashCode 方法
    @Override
    public int hashCode() {
        int result = userid != null ? userid.hashCode() : 0;
        result = 31 * result + (username != null ? username.hashCode() : 0);
        result = 31 * result + (email != null ? email.hashCode() : 0);
        result = 31 * result + (token != null ? token.hashCode() : 0);
        return result;
    }
}
